<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- 引入主题样式 -->
<link href="themes/gray/easyui.css" rel="stylesheet">
<!-- 引入图标的样式 -->
<link href="themes/icon.css" rel="stylesheet">
<!-- 先引入jquery -->
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<!-- 引入easyui -->
<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="js/jquery.easyui.min.js"></script>
<script type="text/javascript" src="js/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="js/jquery.etree.js"></script>
<script type="text/javascript" src="js/jquery.etree.lang.js"></script>
</head>
<script type="text/javascript">
$(function(){
	$('#tt').etree({    
	    url:'treeData.do',
	    lines:true,
	    animate:true,
	    onLoadSuccess:function(){
	    	var node = $('#tt').tree('find', 2);
	    	abc(node)
	    },
	    onClick:function(node){
	    	var text = node.id;
	    	console.log(text);
	    	$.ajax({
	    		url:'gettable',
	    		type:'post',
	    		data:{'text':text}
	    	})
	    	$("#table").datagrid({
	    		url:'gettable',/*  更具点击的节点过去数据表格  */
	    		columns:[[
	    			{field:'ctitle',title:'知识内容',width:200},	     
	    			{field:'cname',title:'知识类型',width:400},	     
	    			{field:'ctime',title:'发布日期',width:200},	     
	    		]]
	    	})
	    }
	}); 
	function abc(node){
		var no = node.target
		no.setAttribute("id","tree");
		document.getElementById("tree").innerHTML="1111";
		
	}
/* 	console.log($("#tree"))
	alert($("#tree")) */
	$("#tree").mouseover(function(){
		
	});
	
	
});
</script>
<body class="easyui-layout">
	<div data-options="region:'west',title:'知识类型',split:true"
		style="width: 240px;">
		<ul id="tt" >
			
		</ul>  
		</div>
	<div data-options="region:'center',title:'center title'" style="padding: 5px; background: #eee;">
		<table id = "table"></table>
	</div>
</body>
</html>